== OnTime ==
===NOW SUPPORTING MYSQL OPTION FOR STORAGE OF PLAYER DATA !!!===
====== Note: This version requires update to the output.yml and config.yml files when upgrading from a previous version. Please see the caveat section of the v3.0.x download page for instructions.  ======
Now every MineCraft server can track the playing time (current login, daily, weekly, monthly, and all time) for all players with this powerful, full function plugin.  With //OnTime// a top 10 list can be generated in game, current and total playing statistics can be displayed (also in game), and daily/weekly/monthly reports of all players can be generated and viewed (off line).  Administrators can define// OnTime Rewards// which will cause econ amounts, items, permission group changes, permission grants, command executions, and XP to be automatically issued to a player when they have achieved a specified total playtime on the server. **Rewards can also be issued when players refer other players to the server, or they achieve status as a //top player//.** [[http://dev.bukkit.org/server-mods/vault/|Vault]] is used so //OnTime Rewards// and permissions are supported by multiple economy and permission plugins.

=== Features: ===
**(Items in BOLD are new in the latest 3.0.x release of OnTime)**
\\
\\
//
**Playing Time Statistics**
//
* Display your own OnTime data: (configurable) plugin default: current login, daily,weekly,monthly, and total time on the server
* Display anther player's OnTime data: (configurable) plugin default: days since first login, different days on server, current login time, AFK status, AFK time for login, current day,week, and month OnTime, total OnTime, and next //OnTime reward(s)//
* Display all online players current session and total time
* Display top # players, ranked by total time
* Display of last login time stamp in top # list
* Display top # players, ranked by total time for the day, week, and month
* What is displayed to the player for all of the above can be configured by the administrator.

//
**Rewards**
//
* Define rewards issued to players for their time played on the server:
> *Cash! (Economy)
> *MineCraft Items\\
> *Permission Group Changes\\
> *New Permissions\\
> *Execute (almost) any command\\
> *XP (experience points)\\
\\
* Define Econ, Item, Command, and XP rewards as recurring or **perpetual**
* **[[http://dev.bukkit.org/server-mods/ontime/pages/referred-by-rewards/|Define rewards for referring new players to the server]]**
* Definition of Individual (or indi) Rewards, which can be issued to a specific player at a specified future time.
* Issue some rewards to only members of certain permission groups. e.g. donors
* **Issue rewards to the 'top' players daily, weekly, and/or monthly**
* Display of the next rewards to be issued to all online players
* Enable/disable display of 'reward issued' messages to players
* Ability to suspend issue of rewards while a player is AFK.

//
**Manipulate a Player's Data**
//

* Set a player's //total OnTime//
* Set a player's number of different days on server
* Add time to a player's //total OnTime//
* Remove a player from the OnTime data files
* Configure plugin to exclude players time 'AFK' from total and daily/weekly/monthly calculations

//
**Generate Reports**
//

* HTML and TXT Report format options
* Generate a report file of all players total time and time stamp of last login event
* Generate a report file of all players time on your server today, for the week, or for the month
* Configure the 'first day of the week' for weekly reports
* Configure the 'first day of the month' for monthly reports.
* Auto generation of total, daily, weekly, **and** monthly reports

//
**Manage The //OnTime// Plugin**
//

* **Select method for storing the //OnTime// player data: .dat files (default), .yml files, or MySQL database**
* Auto-purge inactive or players with low total OnTime from the data files
* Scheduled saves of OnTime data to disk
* Auto update of all online players data, file save, and data purge on server shutdown/reset
* 'test commands to simulate login/logout events creating fake OnTime records / test daily reports
* Logging of OnTime auto purge activity, player login and quit events, and reward system events
* Manual and Automated Generation of Backup versions of OnTime '.dat' files.
*[[http://dev.bukkit.org/server-mods/ontime/pages/other-functions/#w-data-import| Import]] playername and //total OnTime// data from a .yml file.
* **[[http://dev.bukkit.org/server-mods/ontime/pages/other-functions/#w-data-import|Import ]]playername, //total OnTime// and last login data from the [[http://dev.bukkit.org/server-mods/logblock/|'logblock plugin]]' MySQL database.**

//
**Other Plugin Integration **
//

* Use of [[http://dev.bukkit.org/server-mods/vault/|Vault]] for support of multiple economy and permission plugins
* Integration with Vault Permissions for group changes and permissions add
* **Import playername, //total OnTime// and last login data from the 'l[[http://dev.bukkit.org/server-mods/logblock/|ogblock plugin]]' MySQL database.**
>
\\
> Please see the [[http://dev.bukkit.org/server-mods/ontime/pages/|pages]] for permissions, configuration, commands, etc.
\\
=== Installation ===
# Place ontime.jar in your plugin folder
# Download  [[http://dev.bukkit.org/server-mods/vault/|vault.jar]] and place that also in your plugin folder
# (Option) Download Essentials [[http://dev.bukkit.org/server-mods/essentials/|GroupManager.jar]] ** or another Vault supported permissions plugin** and place that in your plugin folder
# Reset your server
\\
\\
If the **optional** Permissions plugin is installed:
# Edit /plugin/ontime/rewards.yml, listing the permissions groups from lowest to highest under the 'groups:' keyword
\\
\\
If the **optional** commands rewards are to be used:
# Edit /plugin/ontime/rewards.yml, defining the commands that can be 'rewarded' under the 'commands:' keyword
\\
\\
If the **optional** MySQL database is to be used to maintain the player data:
# Edit the /plugin/ontime/config.yml, enabling the use of mysql and setting up the definition of the MySQL database.
\\
\\
If the you want to change the output the plugin sends a player:
# Edit /plugin/ontime/output.yml, following the instructions found in that file.
\\
\\
# If the config.yml, output.yml and/or rewards.yml have been modified, then you must reset your server again
\\
=== Future Enhancements Under Consideration ===

* YML storage of OnTime data (.dat) (DONE! V3.0 0)
* MySQL storage (option) of OnTime data (DONE! V3.0.0)
* Rewards to players when players they recommend log OnTime (aka subids) (DONE! V3.0.0)
* Rewards to top players (DONE! V3.0.1)
* Ability to track daily, weekly, and monthly (not just one of the three) (DONE! V3.0.0)
* Group-based reward multipliers
* Improved In-game help for OnTime commands
* More OnTime based Server Stats

> 
=== Feature Requests: === 
> If you want to request a feature to be added to this plugin, or you think any of the above should be given a higher priority, please submit a ticket or vote for existing ones. 

=== Please Leave Comments ===
I'd love to hear what you think (good and bad) about this plugin.  It will help me know if its worth keeping up on the maintenance.  Thanks. Edge

=== Change Log ===
* v1.0 - Initial upload version (alpha)
* v1.1 - Initial public release
* v1.2 - Fixed typo in report file
* v1.3.0 - tested with CB 1.7 / added daily usage tracking & reports / added remove command
* v1.4.0 - Added OnTime Rewards system and related commands; fixed exception errors on '/ontime' and '/ontime <userid>' commands
* v1.4.1 - Fixed minor error in rewards.yml file generation
* v2.0.0 - Added Item and Group rewards; added 'set' and 'add' commands; added more info to user data display; fixed 'daily' data file corruption error
* v2.0.1 - Improved handling for servers without Essentials GroupManager; Added log entries for use of 'remove', 'set', and 'add' commands.
* v2.1.0 - Added Permission rewards; Added recurring econ and item rewards; Added 'set days' command; Integrated with Vault Permissions (simplified group reward configuration); Fixed 'days on' counting error
* v2.2.0 - Added HTML option for report output; Added weekly vs daily option for short-term tracking; Added '/ontime today/week' top user display; Added enable/disable of reward msgs to players; Fixed error with recurring rewards when inventory full
* v2.2.1 - Fixed several errors including permissions plugin sync, kick event extra time credits, and HTML weekly/daily output.
* v2.3.0 - Added configurable output when rewards are issued, information displayed in 'ontime' command, and headers in 'Top xx'; Added 'individual' reward definition and associated commands; Modified syntax of 'Top xx' command; Fixed various errors including [SEVERE] error seen when rewards are disabled, and incorrect file paths on non-windows servers.
* v2.3.1 - Added command (/ontime backup) and automated generation of backup of data files.
* v2.4.0 - Added exclusive (permission group) rewards and associated commands; Added detection of players' 'AFK' status, with automated removal of time spent AFK from OnTime calculations and rewards decisions; Expanded collection period options to include 'monthly' reporting; added configurable console message logging; fixed several 'null pointer' exception errors reported by users; updated config.yml, rewards.yml, output.yml
* v2.4.1 - Added 'ontime import' command to allow import of player data from other plugins, databases, or hand-edited files.  Enable permission group down grades vis 'ontime rewards set' command. Impoved permission group scheduling algorithm. Fixed errors with AFK function.
* v2.4.2 - Added group permission 'exception' such that players purged by OnTime can be down graded to a 'lower' permission group.  Fixed error where plugin reload or server resets were resulting in total OnTime calculation errors.
* v3.0.0 - Added MySQL storage option; Added import of playing time data from 'logblock' plugin MySQL database; Added 'referred by' rewards; Added 'perpetual' reward definition; Added new commands for these features; fixed a bunch of minor bugs
* v3.0.1 - Added 'top player' rewards;  Fixed issue where OnTime was calculating the time of day incorrectly when issuing daily, weekly reports; Fixed issue where wrong 'start date' was put into weekly, and monthly reports; Fixed issue with "ontime top xx today" starting with #2, not #1.